home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Microsoft Bookshelf 1993
/
Microsoft Bookshelf (1993 Edition)(Microsoft Corporation)(CDRM1067820).iso
/
bin
/
books93.mst
< prev
next >
Wrap
Text File
|
1993-03-30
|
36KB
|
1,100 lines
'**************************************************************************
'* Microsoft Multimedia Publishing Group Setup
'* Microsoft Bookshelf CD-ROM Reference Library - 1993 Edition
'* (c) 1993 Microsoft Corporation. All Rights Reserved.
'************************************************************************
''** disabled $DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
DECLARE FUNCTION WinExec LIB "kernel" (a$,b%) AS INTEGER
DECLARE FUNCTION GetModuleHandle LIB "kernel" (a$) AS INTEGER
DECLARE SUB FreeModule LIB "kernel" (a%)
DECLARE FUNCTION GetModuleUsage LIB "kernel" (a%) AS INTEGER
DECLARE FUNCTION OpenDriver LIB "user" (a$, b$, c$) AS INTEGER
DECLARE FUNCTION ExitWindowsExec LIB "user" (a$, b$) AS INTEGER
DECLARE FUNCTION AddFontResource LIB "gdi" (a$) AS INTEGER
DECLARE FUNCTION SendMessage LIB "user" (a%,b%,c%,d$) AS INTEGER
DECLARE FUNCTION FindWindow LIB "user" (a$,b$) AS INTEGER
DECLARE FUNCTION ShowWindow LIB "user" (a%,b%) AS INTEGER
DECLARE FUNCTION FAsyncAudio LIB "mscuistf.dll" AS INTEGER
DECLARE FUNCTION IReplaceTbarBmpsIfDifferent LIB "tbar.dll" (a$,b$,c%) AS INTEGER
DECLARE FUNCTION Kill92Group LIB "mscuistf.dll" (a$) AS INTEGER
DECLARE FUNCTION Kill91Group LIB "mscuistf.dll" (a$) AS INTEGER
DECLARE FUNCTION CheckForCD LIB "mscuistf.dll" (a$) AS INTEGER
DECLARE SUB KillViewer LIB "mscuistf.dll" (a$)
DECLARE SUB KillGroups LIB "mscuistf.dll" ()
DECLARE SUB UpgradeQkeys LIB "mscuistf.dll" ()
''SendMessage() IDs
CONST WM_WININICHANGE = &H001A
CONST WM_FONTCHANGE = &H001D
CONST SW_SHOWMINIMIZED = 2
''Dialog ID's
CONST WINSPACE = 2000
CONST WINSPACE_HELP = 2050
CONST WELCOME = 100
CONST WELCOME_UPGR = 1200
CONST INSERT_OLDDISK = 1700
CONST RE_INSERT = 1900
CONST NO_OLDBOOK = 1800
CONST HELP_WELCOME = 2800
CONST HELP_SYS_CHECK = 3000
CONST ASKEXIT = 200
CONST BOOK_RUNNING = 1400
CONST DESTPATH = 300
CONST DESTPATH_EXISTING = 305
CONST DESTPATH_HELP = 350
CONST NOLOCALSPACE = 1000
CONST NOLOCALSPACE_HELP = 1050
CONST INVALID_DIR = 1100
CONST INVALID_GROUP = 1130
CONST TOOBIG = 900
CONST TOOBIG_HELP = 950
CONST OPTIONS_1 = 800
CONST OPTIONS_2 = 850
CONST OPTIONS_BTN1 = 810 '' 'What IS' dialog id
CONST OPTIONS_BTN2 = 820
CONST OPTIONS_BTN3 = 830
CONST OPTIONS_BTN4 = 840
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST EXITSUCCESS_30 = 750
CONST BLBD_REGISTER = 1300
CONST CHECKINGDLG = 170
CONST SYSCHECK_DLG = 1120
CONST OLD_BS_EXIST = 1500
CONST OLD_BS_HELP = 1170
CONST KILL_VIEWER = 1160
CONST EXIT_RESTART = 2000
CONST WORD_INI$ = "Microsoft Word 2.0"
CONST BOOK_INI$ = "Bookshelf"
CONST PROG_GRP$ = "Bookshelf - 1993"
CONST CHECK_QK = 1
CONST MULTI_ICON = 1
CONST CHECK_WW = 2
CONST EW_RESTARTWINDOWS = 66
' ALL UPGRADE DIALOG ID
' ---------------------
CONST UPG_1 = 2700
CONST HELP_UPG_1 = 2900
CONST UPG_2 = 2600
'' Size of how much space will be needed to instal base files.
'' These estimates assuming 4k sector size on disk.
CONST WIN_SIZE_K= 544
CONST WIN_SIZE = 544000
CONST WORD_SIZE = 180000
CONST BS_SIZE = 900000
CONST TOT_SIZE = WIN_SIZE + WORD_SIZE + BS_SIZE
''Bitmap ID
CONST LOGO = 1
GLOBAL SRCDIR$ '' CD root path (location of setup.exe)
GLOBAL WININI$ '' Fully-qualified path to WIN.INI
GLOBAL DEST$ '' Default destination directory.
GLOBAL BookDir$ '' Default destination directory.
GLOBAL WordDir$ '' Location of Winword.exe
GLOBAL VIEWINI$ '' full pat to viewer.ini (in windows directory)
GLOBAL fKillView91%
GLOBAL fKillView92%
'**************************************************************************
'**************************************************************************
'**
'** Multimedia Publishing Group - Setup Script
'**
'** Modify the following DEFINES and routines to customize setup
'** for a specific product
'**
'**************************************************************************
'**************************************************************************
DECLARE SUB Install '' Modify for specific runtimes
DECLARE SUB InstallFonts '' Modify for custom fonts
DECLARE SUB CreateProgMan '' Modify for Program Groups/Items
DECLARE SUB InstallQuicKeys '' Install quickeys.
DECLARE SUB InstallWinWord '' Set DEFINE to enable/disable
DECLARE SUB UpdateQuicKeys (szInifile$ , szOldBook$, szNewBook$, szDefault$)
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE SUB RemoveViewer(szPath$) ' ask to remove viewer files
'**************************************************************************
'**************************************************************************
'**************************************************************************
'** General Installation Script
'**************************************************************************
INIT:
'' maximize window
i% = FindWindow ("Stuff-Shell","Setup")
IF i%<>0 THEN
i% = ShowWindow (i%, 3)
ELSE
i% = DoMsgBox ("I am a stud!","setup message",0)
ENDIF
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
NL$ = Chr$(13) + Chr$(10) '' Define newline
TAB$ = Chr$(9) '' Define a tab
'' Use bad exit as default untill you've done a clean setup
dlg_EXIT% = EXITQUIT
SetBitmap CUIDLL$, LOGO
SetTitle "Setup for " + PROG_GRP$
SRCDIR$ = GetSymbolValue("STF_SRCDIR")
WININI$ = MakePath(GetWindowsDir(),"WIN.INI")
VIEWINI$ = MakePath(GetWindowsDir(), "VIEWER.INI")
SPLITPATH SRCDIR$,DRIVE$,PATH$,FILENAME$,EXT$
' IF VIEWER IS RUNNING ASK USER TO QUIT IT FIRST
' ALSO DO THE SAME FOR WORD (THAT'S OK, BETTER WAY IS TO WAIT UNTIL USER WANT TO
' INTEGRATE WORD TO BOOKSHELF. BUT THIS IS NO BIG DEAL.)
' ------------------------------------------------------------------------------
'' Find out if we can integrate with WinWord 2.0.
'' Find out if the Winword 2.0 section is in win.ini and if
'' the key 'programdir' point to a valid dir and it isn't a on a
'' network drive, we aren't going to support integrating with
'' network versions of Winword.
'' fWW% will be set to 0 if there is no valid version of Winword 2.0.
fWW% = 0
IF ( DoesIniSectionExist(WININI$, WORD_INI$) <> 0) THEN
WordDir$ = GetIniKeyString(WININI$, WORD_INI$, "programdir")
IF WordDir$ <> "" THEN
SPLITPATH WordDir$,DRIVE$,PATH$,FILENAME$,EXT$
IF (IsDriveNetwork(DRIVE$) <> 1) AND (DoesFileExist(MakePath(WordDir$,"WINWORD.EXE"),femExists) = 1) THEN
fWW% = 1
ENDIF
ENDIF
ENDIF
fMVrunning% = GetModuleHandle("MVAPI") ' check for viewer doesn't seem to work
fMV2running% = GetModuleHandle("MVAPI2")
'' fWWrunning% will be set to 0 if it isn't Winword isn't currently
'' running or if fWW% is 0.
IF fWW% <> 0 THEN
fWWrunning% = GetModuleHandle("MSWORD")
ELSE
fWWrunning% = 0
ENDIF
IF (fMVrunning% <> 0) or (fMV2running% <> 0) THEN
AreRunning$ = "Setup has detected active Multimedia applications or an old version of QuicKeys."
AreRunning$ = AreRunning$ + NL$ + "Please close these applications, and run Setup again." + NL$
i% = DoMsgBox(AreRunning$ , "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END '' Exit Setup
ENDIF
IF (fWWrunning% <> 0) THEN
AreRunning$ = "Setup must update or change files used by Microsoft Word:" + NL$
AreRunning$ = AreRunning$ + NL$ + "Please close this application and run Setup again." + NL$
i% = DoMsgBox(AreRunning$ , "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END '' Exit Setup
ENDIF
' CHECK TO DISK SPACE
' -------------------
BookDir$ = MAKEPATH( SRCDIR$ , "BOOKS\")
'' Read in file list from BOOKS93.inf
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "BOOKS93.INF"
END IF
ReadInfFile szInf$
'' Add the files that will always be needed for the windows directory
'' so that we can find out if there is enough space to install on
'' the windows dir.
' NOTE: (ung)
' ----
' SHOULD CHECK ALL COPY COST LATER AFTER WE GET ALL THE FILES NEEDED TO COPY
' --------------------------------------------------------------------------
' --------------------------------------------------------------------------
' AddSectionFilesToCopyList "BS93Sys", SRCDIR$, GetWindowsSysDir$
' IF GetCopyListCost("","","") <> 0 THEN
' SPLITPATH GetWindowsSysDir$,DRIVE$,PATH$,FILENAME$,EXT$
' '' Fill in the Dialogue box
' sz$ = "There is not enough space on the " + DRIVE$ + " drive to install Bookshelf." + NL$
' sz$ = sz$ + "Setup must install some files in the Windows directory on this drive." + NL$
' sz$ = sz$ + "Please remove some files to free " + Str$(WIN_SIZE_K) + "K of space, then run Setup again."
' i% = DoMsgBox(sz$ , "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
' UIPopAll
' END '' Exit Setup
' ENDIF
' WHEN WE GET ALL CHECKS ARE OK ( WIN VER, VIEWER NOT RUUNING, DISK SPACE OK)
' ---------------------------------------------------------------------------
' remove some dll for viewer ( this should be viewer job)
hModule% = GetModuleHandle("MVBRKR2")
IF hModule% <>0 THEN
WHILE GetModuleUsage(hModule%) > 1
FreeModule(hModule%)
WEND
FreeModule(hModule%)
ENDIF
WELCOME:
' Check for upgrate installation. If it is an upgrade setup, check for a file in the
' books directory depending on the year. If the file exists we do the normal installation
' else inform the user the fact and quit(NO MERCY!).
'----------------------------------------------------------------------------------------
upgrade = 0
IF (DoesFileExist(SRCDIR$+"bin\upgrade.txt", cmoNone)<>0)THEN
upgrade = 1
i% =0
sz$ = UIStartDlg(CUIDLL$, WELCOME_UPGR, "FInfoDlgProc", HELP_WELCOME, HELPPROC$)
IF sz$="CONTINUE" THEN
UIPop 1
' Check for old bookshelf
' -----------------------
NEXTTRY:
sz$ = UIStartDlg(CUIDLL$, UPG_1, "FInfoDlgProc", HELP_UPG_1, HELPPROC$)
UIPop 1
IF sz$="CONTINUE" THEN
IF(DoesFileExist(SRCDIR$+"books\cce.db",cmoNone)<>0)THEN 'Sony 1991
GOTO ITEXISTS
ELSEIF(DoesFileExist(SRCDIR$+"books\bks92.ind", cmoNone) <> 0)THEN 'word bun92 and bookshelf 92
GOTO ITEXISTS
ELSEIF(DoesFileExist(SRCDIR$+"books\books.ind", cmoNone) <> 0)THEN 'bookshelf 91
GOTO ITEXISTS
ELSEIF(DoesFileExist(SRCDIR$+"book\world87.db", cmoNone) <> 0)THEN 'bookshelf 87 dos
GOTO ITEXISTS
ELSE
i% = i%+1
IF (i% < 3)THEN
GOTO NEXTTRY ' allow 3 times to try
ENDIF
sz$=UIStartDlg(CUIDLL$, NO_OLDBOOK,"FInfoDlgProc",HELP_UPG_1,HELPPROC$)
GOTO QUIT
END
ENDIF
ELSE
GOSUB ASKEXIT
GOTO WELCOME
ENDIF
ELSE
GOSUB ASKEXIT
GOTO WELCOME
ENDIF
ELSE 'Full installation
sz$ = UIStartDlg("mscuistf.dll", WELCOME, "FInfoDlgProc", HELP_WELCOME, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKEXIT
GOTO WELCOME
END IF
ENDIF
ITEXISTS:
' Ask her to reinsert the disk if upgrade = 1
' ----------------------------
IF upgrade = 0 THEN
GOTO ALLSET
ENDIF
sz$= UIStartDlg(CUIDLL$, UPG_2, "FInfoDlgProc", 0, "")
UIPop 1
IF sz$ = "CONTINUE" THEN
IF(DoesFileExist(SRCDIR$+"books\books93.mvb",cmoNone)<>0)THEN
GOTO ALLSET
ELSE
GOTO ITEXISTS
ENDIF
ELSEIF sz$="HELP" THEN
ELSE
GOSUB ASKEXIT
GOTO ITEXISTS
ENDIF
ALLSET:
'' Checking for existing bookshelf (91 & 92)
''
OptionsGreyed$ = "OptionsGreyed"
CheckItemsIn$ = "CheckItemsIn"
AddListItem CheckItemsIn$, "OFF"
AddListItem CheckItemsIn$, "OFF"
bookExist% = 0
i% = DoesIniSectionExist(VIEWINI$, "WA91")
IF i%=0 THEN
AddListItem OptionsGreyed$, "0"
ELSE
AddListItem OptionsGreyed$, "1"
bookExist% = 1
ENDIF
' CHECK FOR BOOK 92
' -----------------
i% = DoesIniSectionExist(VIEWINI$, "WA92")
IF i% = 0 THEN
AddListItem OptionsGreyed$, "0"
ELSE
AddListItem OptionsGreyed$, "1"
bookExist% = bookExist% + 1
ENDIF
IF bookExist% > 0 THEN
OLDEXIST:
sz$=UIStartDlg(CUIDLL$, OLD_BS_EXIST, "FCheckDlgProc",OLD_BS_HELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSEIF sz$ = "EXIT" THEN
GOSUB ASKEXIT
GOTO OLDEXIST
ELSEIF sz$ = "REACTIVATE" THEN
GOTO OLDEXIST
ELSE
GOTO OLDEXIST
ENDIF
ENDIF
GETPATH:
'**
'** 'Search for disk space.
'**
LocalDrives$ = "LocalDrives"
GetLocalHardDrivesList LocalDrives$
n% = GetListLength(LocalDrives$)
FOR i% = 1 TO n% STEP 1
DRIVE$ = GetListItem(LocalDrives$,i%)
Size& = GetFreeSpaceForDrive(DRIVE$)
IF Size& > BS_SIZE THEN
Dest_Drive$ = DRIVE$
GOTO FOUND_SPACE
ENDIF
NEXT i%
'' Couldn't find any local Hard Drive with enough
'' space for instaling bookshelf.
Dest_Drive$ = "C"
NOSPACE:
sz$ = UIStartDlg(CUIDLL$, NOLOCALSPACE , "FEditDlgProc", NOLOCALSPACE_HELP, HELPPROC$)
'' They want to continue anyway.
IF sz$ = "CONTINUE" THEN
UIPop 1
GOTO FOUND_SPACE
ELSEIF sz$ = "REACTIVATE" THEN
GOTO NOSPACE
ELSE
GOSUB ASKEXIT
GOTO NOSPACE
END IF
FOUND_SPACE:
DEST$ = Dest_Drive$ + ":\BSHELF93"
DLG_VIEWER% = DESTPATH
' ***
' *** Do CDTest and system check
' ***
'' See if we install from the network drive
szSrcDir$ = GetSymbolValue("STF_SRCDIR")
szSrcDrv$ = Mid$(szSrcDir$, 1, 1)
IF (IsDriveNetwork (szSrcDrv$) = 1) AND (CheckForCD(szSrcDrv$) = 0) THEN
SetSymbolValue "szNetDrive", "1"
SetSymbolValue "testpath", "NETWORK"
ELSE
SetSymbolValue "szNetDrive", "0"
SetSymbolValue "testpath", MAKEPATH(SRCDIR$,"BOOKS\MM\T006838A.WAV")
ENDIF
sz$ = UIStartDlg(CUIDLL$, CHECKINGDLG, "CheckingDlgProc", 0, "")
SYSCHECK:
sz$ = UIStartDlg(CUIDLL$, SYSCHECK_DLG, "SysCheckDlgProc",HELP_SYS_CHECK,HELPPROC$)
IF sz$ = "CONTINUE" THEN
RemoveSymbol "szNetDrive"
UIPop 2
ELSEIF sz$ = "EXIT" THEN
GOSUB ASKEXIT
GOTO SYSCHECK
ELSEIF sz$ = "REACTIVATE" THEN
GOTO SYSCHECK
ELSE
dlg_WHAT_IS% = Val(sz$)
sb$=GetSymbolValue ("bStatus")
IF sb$ = "ok" THEN
dlg_WHAT_IS% = dlg_WHAT_IS%+1000
ELSEIF sb$ = "warning" THEN
dlg_WHAT_IS% = dlg_WHAT_IS%+2000
ELSE
dlg_WHAT_IS% = dlg_WHAT_IS%+3000
ENDIF
GOSUB WHAT_IS
GOTO SYSCHECK
ENDIF
'' All system hardware test is fine when we get here.
'' Prompt the user for options.
'' Initialize dlg box
CheckItemsState$ = "CheckItemsState"
AddListItem CheckItemsState$, "OFF" '' set multiple icons to off
dlg% = OPTIONS_1
IF fWW% <> 0 THEN '' need to integrate Word
dlg% = OPTIONS_2
AddListItem CheckItemsState$, "ON" '' for Word for Windows check box
END IF
'' Set the path edit text box
sz$=GetIniKeyString(VIEWINI$, "files", "BOOKS93.dll")
IF sz$ <> "" THEN
pos% = instr(sz$,",")
IF pos%<>0 THEN
sz$ = mid$(sz$,1,pos%-1)
ENDIF
SetSymbolValue "EditTextIn", sz$
ELSE
SetSymbolValue "EditTextIn", DEST$
ENDIF
SetSymbolValue "EditFocus", "END"
''//////////////////////
OPTIONS:
sz$ = UIStartDlg(CUIDLL$, dlg% , "FCustInstDlgProc", 0, "")
DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(DEST$) = 0 THEN
dlg_WHAT_IS% = INVALID_DIR
GOSUB WHAT_IS
GOTO OPTIONS
ELSE
gr$=GetSymbolValue("groupName")
gr$ = LTRIM$(gr$)
gr$ = RTRIM$(gr$)
IF gr$ = "" THEN
dlg_WHAT_IS% = INVALID_GROUP
GOSUB WHAT_IS
GOTO OPTIONS
ENDIF
ENDIF
'' Find out if there is enough disk space.
Prev% = ShowWaitCursor()
AddSectionFilesToCopyList "BS93Sys", SRCDIR$, GetWindowsSysDir$
AddSectionFilesToCopyList "Bookshelf", SRCDIR$, DEST$
AddSectionFilesToCopyList "BooksDir", BookDir$, DEST$
AddSectionFilesToCopyList "BS93Win", SRCDIR$, GetWindowsDir()
' We decided co copy all viewer stuffs to \windows\system 3/4/93
' -------------------------------------------------------------
AddSectionFilesToCopyList "Viewer", SRCDIR$, GetWindowsSysDir()
'' Add multiple icons if the user select multiple
'' books for bookshelf
''
sz$ = GetListItem(CheckItemsState$, MULTI_ICON)
IF sz$ = "ON" THEN
AddSectionFilesToCopyList "MultiIcons", BookDir$, DEST$
ENDIF
IF GetCopyListCost("","","") <> 0 THEN
RestoreCursor Prev%
'' Not enough space
sz$ = UIStartDlg(CUIDLL$, TOOBIG , "FInfoDlgProc", 0, "")
IF sz$ <> "BACK" THEN
GOSUB ASKEXIT
ENDIF
'' clear list and put back the windows files
ClearCopyList
UIPop 1
GOTO OPTIONS
ENDIF
'' Find out if we there is enough space to prompt for the WinWord 2.0
'' integration.
RestoreCursor Prev%
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO OPTIONS
ELSEIF sz$ = "BTN1" THEN
dlg_WHAT_IS% = OPTIONS_BTN1
GOSUB WHAT_IS
GOTO OPTIONS
ELSEIF sz$ = "BTN2" THEN '' help for integrating word
dlg_WHAT_IS% = OPTIONS_BTN2
GOSUB WHAT_IS
GOTO OPTIONS
ELSEIF sz$ = "BTN3" THEN '' help for program group
dlg_WHAT_IS% = OPTIONS_BTN3
GOSUB WHAT_IS
GOTO OPTIONS
ELSEIF sz$ = "BTN4" THEN
dlg_WHAT_IS% = OPTIONS_BTN4
GOSUB WHAT_IS
GOTO OPTIONS
ELSEIF sz$ = "CHK1" THEN '' Multiple icons for bookshelf
sz$ = GetListItem(CheckItemsState$, CHECK_QK)
IF sz$ = "ON" THEN
ReplaceListItem CheckItemsState$, CHECK_QK, "OFF"
ELSEIF sz$ = "OFF" THEN
ReplaceListItem CheckItemsState$, CHECK_QK, "ON"
ENDIF
GOTO OPTIONS
ELSEIF sz$ = "CHK2" THEN
sz$ = GetListItem(CheckItemsState$, CHECK_WW)
IF sz$ = "ON" THEN
ReplaceListItem CheckItemsState$, CHECK_WW, "OFF"
ELSEIF sz$ = "OFF" THEN
ReplaceListItem CheckItemsState$, CHECK_WW, "ON"
ENDIF
GOTO OPTIONS
ELSE '' Exit, Cancel, or unknown button
GOSUB ASKEXIT
GOTO OPTIONS
END IF
'' Find out if they want winword integration
'' and multiple icons
IF fWW% <> 0 THEN
sz$ = GetListItem(CheckItemsState$, CHECK_WW)
IF sz$ <> "ON" THEN
fWW% = 0
ELSE
fWW% = 1
AddSectionFilesToCopyList "BS93Word", SRCDIR$, WordDir$
AddSectionFilesToCopyList "BS93WordWin", SRCDIR$, GetWindowsDir()
AddSectionFilesToCopyList "BS93WordSys", SRCDIR$, GetWindowsSysDir()
ENDIF
ENDIF
'**********************************************
'**** ******
'**** CLEAN UP OLD BOOKS 91 and 92 ******
'**** ******
'**********************************************
'
i% = GetListLength("CheckItemsOut")
UpgradeQkeys
IF i% > 0 THEN
files$ = "files"
sz$ = GetListItem("CheckItemsOut",1)
IF sz$ = "ON" THEN '' delete the 1991 book
' DELETE DIRECTORY
' ----------------
'' Remove all the 92 [section] in view.ini
'' ---------------------------------------
RemoveIniSection VIEWINI$, "Cquote", cmoOverwrite
RemoveIniSection VIEWINI$, "bquote", cmoOverwrite
RemoveIniSection VIEWINI$, "WA91", cmoOverwrite
RemoveIniSection VIEWINI$, "Encyc", cmoOverwrite
RemoveIniSection VIEWINI$, "Roget", cmoOverwrite
RemoveIniSection VIEWINI$, "Dict", cmoOverwrite
RemoveIniSection VIEWINI$, "Atlas", cmoOverwrite
RemoveIniSection VIEWINI$, "Books", cmoOverwrite
load$=GetIniKeyString(WININI$, "windows", "load")
IF load$ <> "" THEN
load$ = UCASE$(load$)
i% = INSTR(load$,"QUICKEYS")
n% = 0
IF i% <> 0 THEN
FOR j% = i% TO 1 STEP -1
n% = n%+1
IF mid$(load$,j%,1) = " " THEN
GOTO FOUND
ENDIF
NEXT j%
FOUND:
IF j% = 0 THEN
j%=1
ENDIF
dir$=MID$(load$, j%, n%-2)
' k%=DoMsgBox("dir",dir$,MB_OK)
fKillView91% = Kill91Group(dir$) 'flag to delete viewer 91
IF j% > 1 THEN
newLoad$ = MID$(load$, 1, j%-1)
ENDIF
newLoad$= newLoad$+MID$(load$, i%+12, LEN(load$))
CreateIniKeyValue WININI$, "windows", "load", newLoad$, cmoOverwrite
ENDIF
ENDIF
ENDIF
sz$ = GetListItem("CheckItemsOut",2)
IF sz$ = "ON" THEN '' delete the 1992 book
' REMOVE KEYSTRINGS
' ----------------
RemoveIniKey VIEWINI$, files$, "Cquote92.MVB", cmoOverwrite
RemoveIniKey VIEWINI$, files$, "BQuote92.MVB", cmoOverwrite
RemoveIniKey VIEWINI$, files$, "WA92.MVB", cmoOverwrite
RemoveIniKey VIEWINI$, files$, "Encyc92.MVB", cmoOverwrite
RemoveIniKey VIEWINI$, files$, "Roget92.MVB", cmoOverwrite
RemoveIniKey VIEWINI$, files$, "Dict92.MVB", cmoOverwrite
RemoveIniKey VIEWINI$, files$, "Atlas92.MVB", cmoOverwrite
RemoveIniKey VIEWINI$, files$, "Books92.MVB", cmoOverwrite
' REMOVE SECTIONS
' ---------------
RemoveIniSection VIEWINI$, "Cquote92", cmoOverwrite
RemoveIniSection VIEWINI$, "bquote92", cmoOverwrite
RemoveIniSection VIEWINI$, "WA92", cmoOverwrite
RemoveIniSection VIEWINI$, "Encyc92", cmoOverwrite
RemoveIniSection VIEWINI$, "Roget92", cmoOverwrite
RemoveIniSection VIEWINI$, "Dict92", cmoOverwrite
RemoveIniSection VIEWINI$, "Atlas92", cmoOverwrite
RemoveIniSection VIEWINI$, "Books92", cmoOverwrite
' Kill the program group and delete files
' ---------------------------------------
szPath$ = GetIniKeyString(WININI$, "multimedia viewer", "ViewerPath")
fKillView92%=Kill92Group(szPath$)
ENDIF
' ****************************************************************************
' *** Delete Viewer. Present a dialog with the checkbox and ask if the user
' *** want to delete the viewer files.
' ***
' ****************************************************************************
IF fKillView91%=1 or fKillView92%=1 THEN
RemoveSymbol "OptionsGreyed"
RemoveSymbol "CkeckItemsIn"
AddListItem "CkeckItemsIn", "ON"
DELVIEWER:
sz$=UIStartDlg("mscuistf.dll", KILL_VIEWER, "FCheckDlgProc", 0, "")
IF sz$ = "CONTINUE" THEN
UIPop 1
check$ = GetListItem ("CheckItemsOut",1)
IF check$ = "ON" THEN
KillViewer(szPath$)
ENDIF
ELSEIF sz$ = "EXIT" THEN
UIPop 1
GOSUB ASKEXIT
GOTO DELVIEWER
ELSE
GOTO DELVIEWER
ENDIF
ENDIF
ENDIF
'' Kill the progman groups
KillGroups
'' Check if msacm is loaded.
sz$ = GetIniKeyString(MAKEPATH(GetWindowsDir(),"system.ini"),"drivers","wavemapper")
sz$ = UCASE$(sz$)
fMsacmNew% = INSTR(sz$,"MSACM")
SetRestartDir DEST$
Install
IF fWW% = 1 THEN
fWWrunning% = GetModuleHandle("MSWORD")
WHILE fWWrunning% <> 0
AreRunning$ = "Setup must update or change some of the files used by Microsoft Word" + NL$
AreRunning$ = AreRunning$ + NL$ + "Please Quit Microsoft Word and press OK"
i% = DoMsgBox(AreRunning$ , "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
fWWrunning% = GetModuleHandle("MSWORD")
WEND
InstallWinWord
ENDIF
''*****************************************************************
IF (RestartListEmpty()=1) AND (fMsacmNew%<>0) THEN
dlg_EXIT% = EXITSUCCESS
'' Load qkeys.
i% = OpenDriver ("QKeys","drivers","")
ELSE
dlg_EXIT% = EXIT_RESTART
ENDIF
QUIT:' this is where we 'magically' come when user cancel during file copy
ON ERROR GOTO ERRQUIT
UIPopALL
sz$ = UIStartDlg(CUIDLL$, dlg_EXIT%, "FinfoDlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUIT
ELSEIF sz$ = "EXIT" THEN
if (RestartListEmpty()=1) THEN
sz$ = "WARNING: To take full advantage of Bookshelf features, you must restart windows. Restart Windows now?"
i% = DoMsgBox (sz$,"Setup Message",4)
if i% = 6 THEN
i% = ExitWindowsExec (MAKEPATH(DEST$,"_msrstrt.exe"),"")
GOTO QUIT
ENDIF
END
ELSE
GOSUB ASKEXIT
GOTO QUIT
ENDIF
ELSEIF sz$ = "CONTINUE" THEN ' Restart windows
IF dlg_EXIT% = EXIT_RESTART THEN
''i% = ExitExecRestart()
i% = ExitWindowsExec (MAKEPATH(DEST$,"_msrstrt.exe"),"")
GOTO QUIT
ENDIF
END
ENDIF
END
ERRQUIT:
i% = DoMsgBox("Setup sources were corrupted, call Microsoft Product Support Services at (206) 454-2030 for assistance.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
ASKEXIT:
sz$ = UIStartDlg(CUIDLL$, ASKEXIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
END '' Exit Setup
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKEXIT
ELSE
UIPop 1
END IF
RETURN
WHAT_IS:
sz$ = UIStartDlg(CUIDLL$, dlg_WHAT_IS%, "FInfoDlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO WHAT_IS
END IF
UIPop 1
RETURN
'*************************************************************************
'**
'** Install
'** -------
'**
'** Purpose:
'** Performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
'' ASSERT DEST$ points to the selected drive to install viewer
'' ASSERT the copy list has been filled in.
CreateDir DEST$, cmoNone
''AddBlankToBillboardList 1024
AddToBillboardList "mscuistf.dll", BLBD_REGISTER, "FModelessDlgProc",2048
SetCopyGaugePosition 160, 20
' Install Driver and fix section in system.ini
'' --------------------------------------------
sz$ = GetWindowsDir()
CreateIniKeyValue sz$+"system.ini", "drivers","wavemapper","msacm.drv", cmoOverwrite
CreateIniKeyValue sz$+"system.ini", "drivers","qkeys","qkeys.drv", cmoOverwrite
CreateIniKeyValue WININI$, BOOK_INI$, "TBOX", "1", cmoOverwrite
CreateIniKeyValue WININI$, BOOK_INI$, "TBOX", "1", cmoOverwrite
CreateIniKeyValue WININI$, "Multimedia Viewer", "M_WindowPosition", "[0,0,640,480,0]" ,cmoNone
ss$=GetIniKeyString(sz$+"system.ini", "boot", "drivers")
ss$=UCASE$(ss$)
IF Instr(ss$, "QKEYS.DRV")=0 THEN
CreateIniKeyValue sz$+"system.ini", "boot", "drivers", ss$+" qkeys.drv", cmoOverWrite
ENDIF
CopyFilesInCopyList
InstallFonts
' Fix the view.ini
' ----------------
ViewerIni$ = MakePath(GetWindowsDir,"Viewer.ini")
ErrStr$ = "Please insert the " + PROG_GRP$ + " CD."
files$ = "Files"
CreateIniKeyValue ViewerIni$, files$, "Books93.MVB", BookDir$ + "," + ErrStr$, cmoOverwrite
' Add viewer dll path
' -------------------
winsys$ = GetWindowsSysDir()
CreateIniKeyValue ViewerIni$, files$, "MVTITLE2.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "MVFS2.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "MVSRCH2.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "MVAPI2.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "MVBMP2.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "MVBRKR2.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "MVMCI2.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "MVIEWER2.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "MVAFF.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "MVFTSUI2.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "CTL3D.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "MMP.DLL", winsys$, cmoOverwrite
CreateIniKeyValue ViewerIni$, files$, "BOOKS93.DLL", DEST$, cmoOverwrite
Command$ = GetWindowsSysDir()+"MVIEWER2.EXE "
gr$=GetSymbolValue("groupName") '' group name was asked in the option dialog
gr$ = LTRIM$(gr$)
gr$ = RTRIM$(gr$)
CreateProgmanGroup gr$, "", cmoOverwrite
'' check for multiple icons for bookshelf
sz$ = GetListItem("CheckItemsState", CHECK_QK)
fMI% = 1 '' multi icon for bookshelf
IF sz$ = "OFF" THEN
fMI% = 0
ENDIF
IF fMI% = 0 THEN
CreateProgmanItem gr$, "Bookshelf 1993", Command$ + "BOOKS93.MVB", MakePath(DEST$, "Books93.ico"), cmoOverwrite
ELSE
ComSwitch$= Command$+"-i"
theBook$=" books93.mvb"
CreateProgmanItem gr$, "Bookshelf 1993", Command$ + "BOOKS93.MVB", MakePath(DEST$, "Books93.ico"), cmoOverwrite
CreateProgmanItem gr$, "Concise Quotes", ComSwitch$+"CCQ_CONTENTS"+theBook$, MakePath(DEST$, "cquote93.ico"), cmoOverwrite
CreateProgmanItem gr$, "Bartlett's", ComSwitch+"BFQ_CONTENTS"+theBook$, MakePath(DEST$, "bquote93.ico"), cmoOverwrite
CreateProgmanItem gr$, "Encyclopedia", ComSwitch$ + "CCE_CONTENTS"+theBook$, MakePath(DEST$, "encyc93.ico"), cmoOverwrite
CreateProgmanItem gr$, "Dictionary", ComSwitch$ + "AHD_CONTENTS"+theBook$, MakePath(DEST$, "dict93.ico"), cmoOverwrite
CreateProgmanItem gr$, "Thesaurus", ComSwitch$ + "RET_CONTENTS"+theBook$, MakePath(DEST$, "roget93.ico"), cmoOverwrite
CreateProgmanItem gr$, "Atlas", ComSwitch$ + "HAM_CONTENTS"+theBook$, MakePath(DEST$, "atlas93.ico"), cmoOverwrite
CreateProgmanItem gr$, "1993 Almanac", ComSwitch$+ "WA_CONTENTS"+theBook$, MakePath(DEST$, "alman93.ico"), cmoOverwrite
ENDIF
CreateProgmanItem gr$, "Bookshelf 1993 ReadMe", "Notepad.exe " + MakePath( SRCDIR$, "readme.txt"),"", cmoOverwrite
CreateProgmanItem gr$, "Bookshelf 1993 Support", "Notepad.exe " + MakePath( SRCDIR$, "finfaq.txt"),"", cmoOverwrite
CreateProgmanItem gr$, "Bookshelf 1993 Overview", "winhelp.exe " + "-imenuHelpDemo " + MakePath( SRCDIR$, "books\bks93.hlp" ), MakePath(DEST$, "bsover.ico") , cmoOverwrite
ShowProgmanGroup gr$, 1, cmoNone
END SUB
'*************************************************************************
'**
'** InstallWinWord
'** -----------------
'**
'** Purpose:
'** Install special WinWord Integration files
'** Arguments:
'** none.
'** Returns:
'** none.
'** Comments:
'**
'*************************************************************************
SUB InstallWinWord STATIC
'** Obtain INI settings
' ASSERT: Word 2.0 section exists in the INI file
' ASSERT: WordDir$ = valid path to winword.exe
DotPath$ = GetIniKeyString(WININI$, WORD_INI$, "DOT-PATH")
IF DotPath$ = "" THEN
DotPath$ = WordDir$
CreateIniKeyValue WININI$, WORD_INI$, "DOT-PATH", WordDir, cmoOverwrite
ENDIF
IF (DoesFileExist(MakePath(DotPath$,"NORMAL.DOT"), femExists) = 1) AND (DoesFileExist(MakePath(DotPath$,"NORMAL.WAB"), femExists) = 0) THEN
CopyFile MakePath(DotPath$,"NORMAL.DOT"), MakePath(DotPath$,"NORMAL.WAB"), cmoNone, 0
ENDIF
'' Make a backup of toolbar bitmap. May be making a backup of
'' a file just created from copylist.
'' ASSERT: The toolbar bitmaps exist because they were in the copy list.
IF DoesFileExist(MakePath(DotPath$,"V2TBAR.WAB"), femExists) = 0 THEN
CopyFile MakePath(DotPath$,"V2TBAR.BMP"), MakePath(DotPath$,"V2TBAR.WAB"), cmoNone, 0
ENDIF
i% = IReplaceTbarBmpsIfDifferent(MakePath(SRCDIR$,"VIEWER\BS93WORD\V2TBAR.BMP"), MakePath(DotPath$,"V2TBAR.BMP"), 25)
IF DoesFileExist(MakePath(DotPath$,"82TBAR.WAB"), femExists) = 0 THEN
CopyFile MakePath(DotPath$,"82TBAR.BMP"), MakePath(DotPath$,"82TBAR.WAB"), cmoNone, 0
ENDIF
i% = IReplaceTbarBmpsIfDifferent(MakePath(SRCDIR$,"VIEWER\BS93WORD\82TBAR.BMP"), MakePath(DotPath$,"82TBAR.BMP"), 25)
'** set INI file settings
CreateIniKeyValue WININI$, WORD_INI$, "LoadToolbarBitmaps", "Yes", cmoOverwrite
CreateIniKeyValue WININI$, BOOK_INI$, "SendToDlg", "1", cmoOverwrite
CreateIniKeyValue WININI$, BOOK_INI$, "HelpFile", MakePath( SRCDIR$, "word\winword.hlp"), cmoOverwrite
CreateIniKeyValue WININI$, BOOK_INI$, "Integration", "2", cmoOverwrite
CreateIniKeyValue WININI$, BOOK_INI$, "ViewerPath", MakePath(GetWindowsSysDir(), "MViewer2"), cmoOverwrite
CreateIniKeyValue WININI$, BOOK_INI$, "BooksPath", MakePath( SRCDIR$, "books\"), cmoOverwrite
'** add macros to NORMAL.DOT (bookshlf.dot must have been copied to progdir)
'' disable quote of the day
CreateIniKeyValue WININI$, BOOK_INI$, "LastQuote", "0", cmoOverwrite
cmd$ = MakePath(WordDir$,"winword.exe" ) + " " + MakePath(WordDir$, "bshelf93.dot") + " /mwabSetup"
ignore% = WinExec(cmd$,SW_SHOWMINIMIZED)
'' enable quote of the day
CreateIniKeyValue WININI$, BOOK_INI$, "LastQuote", "1", cmoOverwrite
END SUB
'*************************************************************************
'**
'** InstallFonts
'** ------------
'**
'** Purpose:
'** Install special Screen (raster) fonts
'** Arguments:
'** none.
'** Returns:
'** none.
'** Comments:
'** ensure that the font files are copied
'** !!CAUTION!! at present, this only installs VGA fonts !!!
'*************************************************************************
SUB InstallFonts STATIC
szKey$ = "Lucida Sans B 10,12,14"
CreateIniKeyValue WININI$, "fonts", szKey$, "VGALSB.FON", cmoOverwrite
szKey$ = "Lucida Sans B1 10,12,14"
CreateIniKeyValue WININI$, "fonts", szKey$, "VGALSB1.FON", cmoOverwrite
szKey$ = "Lucida Sans B2 10,12,14"
CreateIniKeyValue WININI$, "fonts", szKey$, "VGALSB2.FON", cmoOverwrite
szKey$ = "Symbol B"
CreateIniKeyValue WININI$, "fonts", szKey$, "VGASB.FON", cmoOverwrite
ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGALSB.fon"))
ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGALSB1.fon"))
ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGALSB2.fon"))
ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGASB.fon"))
'' make sure windows sees the font addition to WIN.INI
ignore% = SendMessage (-1, WM_WININICHANGED, 0, "fonts")
ignore% = SendMessage (-1, WM_FONTCHANGE, 0, "")
END SUB
'*************************************************************************
'**
'** MakePath
'** --------
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualified path name.
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION